package com.lej.app_interact

import com.google.gson.JsonObject
import com.lej.dataservice.club.bean.interact.CreateSearchHisRsp
import com.lej.dataservice.club.bean.interact.CreatorSearchInfo
import com.lej.dataservice.club.bean.interact.CreatorSearchRsp
import com.lej.dataservice.club.bean.interact.FeedListInfo
import com.lej.dataservice.club.http.BaseResponse
import com.lej.dataservice.club.http.RetrofitClient
import okhttp3.RequestBody
import retrofit2.http.*

interface InteractApiService {
    companion object {
        val instance: InteractApiService =
            RetrofitClient.getInstance().create(InteractApiService::class.java)
    }

    @Headers("Content-Type: application/json")
    @POST("/feed/refresh")
    suspend fun feedList(@Body body: RequestBody): BaseResponse<FeedListInfo>

    /**
     * 搜索创作者
     */
    @Headers("Content-Type: application/json")
    @POST("/creator/search")
    suspend fun searchCreator(@Body body: RequestBody): BaseResponse<CreatorSearchRsp>


    /**
     * 关注，取关创作者  0取消关注 1关注
     */
    @Headers("Content-Type: application/json")
    @POST("/creator/follow")
    suspend fun followCreator(@Body body: RequestBody): BaseResponse<JsonObject>

    /**
     * 创作者主页
     */
    @Headers("Content-Type: application/json")
    @POST("/creator/detail")
    suspend fun getCreatorInto(@Body body: RequestBody):BaseResponse<CreatorSearchInfo>

    /**
     * 搜索历史记录
     */
    @Headers("Content-Type: application/json")
    @POST("/creator/visitHistory")
    suspend fun getVisitHistory():BaseResponse<CreateSearchHisRsp>

}